Set recipient instance variable in Noticed::Base #180
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #179
This is a partial revert of #126 using style from #176.
In #179, issue was identified where the
recipient
was nil inbefore
callbacks on delivery methods. This fixes that issue and adds appropriate tests.There were some other issues I identified while trying to increase test case coverage for callback methods, namely:
CallbackExample
innoticed_test
would raise the argument error thatrecipient
is nil, it is unclear if that is intended behavior:Adding an
around_deliver
callback to Noticed::DeliveryMethods::Test would fail multiple tests, as the#deliver
method would not get calledAdding before/around/after callbacks to CallbackExample on both everything and the database method would only call the everything callbacks, and not the method callbacks. For example, adding
before_deliver
andaround_deliver
callbacks to the example test would result in the test returning[:before_everything, :around_everything, :after_everything]
There's some unclear logic as to what callbacks get called when, and I'm not sure what is expected vs what happens in test vs what happens in an actual implementation, but happy to log to another issue or document elsewhere.